package net.aiform.security.pojo;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import net.aiform.pojo.Identity;
import net.aiform.template.pojo.Template;

@Entity
@Table(name = "af_formac")
@DiscriminatorValue("FormAccessControler")
public class FormAccessController extends Identity implements Serializable {
	private static final long serialVersionUID = 8311090517390801387L;
	private String category;
	@ManyToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "template", referencedColumnName = "id")
	private Template template;
	@OneToMany(mappedBy = "formac", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	private Set<SecMeta> secMeta;

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public Set<SecMeta> getSecMeta() {
		return secMeta;
	}

	public void setSecMeta(Set<SecMeta> secMeta) {
		this.secMeta = secMeta;
	}

	public Template getTemplate() {
		return template;
	}

	public void setTemplate(Template template) {
		this.template = template;
	}

}
